int get_min(int a, int b) {
    return a > b ? b : a;
}
int maxArea(int* height, int heightSize){
    int left = 0, right = heightSize - 1;
    int max = 0;
    while(left != right) {
        int min = get_min(height[left], height[right]);
        if(min * (right - left) > max) {
            max = min * (right - left);
        }
        if(height[left] < height[right]) {
            left++;
        }
        else {
            right--;
        }
    }
    return max;
}